class Cat:

    def __init__(self, name):
        self.name = name

    def eat(self):
        print("%s 爱吃鱼" % self.name)


tom = Cat('Tom')
print(tom.name)
tom.eat()
